#include "subwidget.h"

SubWidget::SubWidget(QWidget *parent)
    : QWidget{parent}
{
    this->setWindowTitle("窗口二");
    button=new QPushButton("显示窗口一",this);
    this->resize(400,300);
    button->move(100,100);
    connect(button,&QPushButton::clicked,this,&SubWidget::sendSignal);//信号触发槽函数-》槽函数发出信号
    // connect(button,&QPushButton::clicked,this,&SubWidget::showWidgetSignal);//这种方式就是信号传递信号
}

void SubWidget::sendSignal()
{
    emit showWidgetSignal();
}
